<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link href="__ACSS__/css.css" rel="stylesheet" type="text/css">
<script language='javascript' src='__AJS__/public.js'></script>
<script src="__PUBLIC__/ckeditor/ckeditor.js"></script>
<import type='js' file='Admin.Js.jquery'/>
<script>
	
	$().ready(function(){
				//商品信息中点击新品和热销图片可以直接生成保存
				$('.cls1').bind('click',function(){		
				if($(this).attr('src')=="__AIMG__/yes.gif"){
					$(this).attr('src',"__AIMG__/no.gif");					
					var no=$(this).attr('src');
					no=0;					
					var id=$(this).attr('id');	
					//把当前所改变的热销ID和值传过去								
					var data={
					g_id:id,
					g_hot:no		
				}
				$.post('__GROUP__/Goods/checkNohot',data,function(msg){},'json');
								
				}else{
					$(this).attr('src',"__AIMG__/yes.gif");
					var yes=$(this).attr('src');
					yes=1;					
					var id=$(this).attr('id');				
					var data={
					g_id:id,
					g_hot:yes		
				}
				$.post('__GROUP__/Goods/checkYeshot',data,function(msg){},'json');
				}										
		});		
		$('.cls2').bind('click',function(){		
				if($(this).attr('src')=="__AIMG__/yes.gif"){
					$(this).attr('src',"__AIMG__/no.gif");					
					var no=$(this).attr('src');
					no=0;					
					var id=$(this).attr('id');				
					var data={
					g_id:id,
					g_new:no		
				}
				$.post('__GROUP__/Goods/checkNonew',data,function(msg){},'json');
								
				}else{
					$(this).attr('src',"__AIMG__/yes.gif");
					var yes=$(this).attr('src');
					yes=1;
					var id=$(this).attr('id');				
					var data={
					g_id:id,
					g_new:yes		
				}
				$.post('__GROUP__/Goods/checkYesnew',data,function(msg){},'json');
				}															
		});
		
		
			//商品信息中点击上架图片可以直接生成保存
				$('.cls3').bind('click',function(){		
				if($(this).attr('src')=="__AIMG__/yes.gif"){
					$(this).attr('src',"__AIMG__/no.gif");					
					var no=$(this).attr('src');
					no=0;					
					var id=$(this).attr('id');	
					//把当前所改变的热销ID和值传过去								
					var data={
					g_id:id,
					g_sale:no		
				}
				$.post('__GROUP__/Goods/checkNosale',data,function(msg){},'json');
								
				}else{
					$(this).attr('src',"__AIMG__/yes.gif");
					var yes=$(this).attr('src');
					yes=1;					
					var id=$(this).attr('id');				
					var data={
					g_id:id,
					g_sale:yes		
				}
				$.post('__GROUP__/Goods/checkYessale',data,function(msg){},'json');
				}										
		});	
		
		
			
	});
	
</script>
<style>
td,th {
	text-align: center
}
.search{
	float:left;
}
</style>
</head>
<SCRIPT language=javascript>
</SCRIPT>
<body>
<h1>
<span class="action-span"><a href="__GROUP__/Goods/addgoods">添加商品信息</a></span>
<span class="action-span1"><a href="">SHOP 管理中心</a> </span><span id="search_id" class="action-span1"> - 商品信息管理 </span>
<div style="clear:both"></div>
</h1>
<h1>
	<form action="__GROUP__/Goods/search" method="get">
<span class="search"><img src="__AIMG__/search.gif"/></span> 
 <span class="action-span1">
 	
 	<select name='c_id' id='c_name' value="<?php echo isset($_GET['c_id'])?$_GET['c_id']:'';?>">
 		<option value='0'> 所有分类  </option> 
		<volist name='data1' id='vo'>			
			<option id="name" value='{$vo.c_id}'>{$vo.c_name}</option>			
		</volist>
		</select>
 	</span>
	<span class="action-span1">
	<select name='b_id' id='b_name' value="<?php echo isset($_GET['b_id'])?$_GET['b_id']:'';?>">
		<option value='0'> 所有品牌  </option>      
		<foreach name='data2' item='vo'>		
				<option value='{$vo.b_id}'>{$vo.b_name}</option>						
		</foreach>
		</select>
 </span>
<span class="action-span1"><font color="#999" size="2">关键词:</font><input type="text" id="search" name="g_name" value="<?php echo isset($_GET['g_name'])?$_GET['g_name']:'';?>"></span>
<span class="action-span1"><input type="submit" id="btnOk" value="搜索"></span>

<div style="clear:both"></div>
</form>		
</h1>
	<form method='post' action='__URL__/deleteAll'>
		<table class="table" cellspacing="1" cellpadding="2" width="99%"
			align="center" border="0">
			<tbody>
				<tr>
					<th class="bg_tr" align="left" height="25">
						<input type='submit' name='deleteSubmit' value='删除' onclick="return confirm('你确定删除么?');"/>
					</th>
					<th class="bg_tr" align="left" height="25">序号</th>
					<th class="bg_tr" align="left" height="25">商品名称</th>
					<th class="bg_tr" align="left" height="25">货号</th>
					<th class="bg_tr" align="left" height="25">品牌名称</th>
					<th class="bg_tr" align="left" height="25">所属分类</th>
					<th class="bg_tr" align="left" height="25">价格</th>
					<th class="bg_tr" align="left" height="25">库存</th>
					<th class="bg_tr" align="left" height="25">上架</th>
					<th class="bg_tr" align="left" height="25">热销</th>
					<th class="bg_tr" align="left" height="25">新品</th>
					<th class="bg_tr" align="left" height="25">缩略图</th>
					<th class="bg_tr" align="left" height="25">排序</th>
					<th class="bg_tr" align="left" height="25">操作</th>
				
				</tr>
				<volist name='data' id='vo'>
				<tr>
					<td class="td_bg" width="2%">
						<input type='checkbox' value="{$vo.g_id}" name='id[]' />
					</td>
					<td class="td_bg" width="3%" height="23" align="center">{$i}</td>
					<td class="td_bg" width="8%">{$vo.g_name}</td>
					<td class="td_bg" width="5%">{$vo.g_sn}</td>
					<td class="td_bg" width="7%">{$vo.b_name}</td>
					<td class="td_bg" width="7%">{$vo.c_name}</td>
					<td class="td_bg" width="5%"><font color="red">&yen;{$vo.g_price}</font></td>
					
					<td class="td_bg" width="5%">{$vo.g_inv}</td>
					<td class="td_bg" width="4%"><if condition="$vo['g_is_sale'] eq 1"><img id="{$vo.g_id}" class="cls3" src="__AIMG__/yes.gif">
					<else/>
					<img class="cls3" id="{$vo.g_id}"  src="__AIMG__/no.gif"/>
					</if></td>
				
					<td class="td_bg" width="4%"><if condition="$vo['g_is_hot'] eq 1"><img id="{$vo.g_id}" class="cls1" src="__AIMG__/yes.gif">
					<else/>
					<img class="cls1" id="{$vo.g_id}"  src="__AIMG__/no.gif"/>
					</if></td>
					<td class="td_bg" width="4%"><if condition="$vo['g_is_new'] eq 1"><img id="{$vo.g_id}" class="cls2" src="__AIMG__/yes.gif">
					<else/>
					<img id="{$vo.g_id}" class="cls2" src="__AIMG__/no.gif"/></if></td></div>
					<td class="td_bg" width="8%"><img id="thumb" src="__HUP__{$vo.g_thumb_img}"/></td>
					<td class="td_bg" width="3%">{$vo.g_sort}</td>
				
					 <td width="8%" align="center" class="td_bg">
					
				      <a href="__GROUP__/Goods/edit/id/{$vo.g_id}"><img src="__AIMG__/edit.gif"/></a> |
				      <a href="__GROUP__/Goods/del/id/{$vo.g_id}" onclick="return confirm('你确定删除么?');" title="移除"><img src="__AIMG__/trash.gif"/></a>
				    </td>
				</tr>
				</volist>
				<tr>
					<td colspan="12">{$show}</td>
				</tr>
			</tbody>
		</table>
	</form>
</body>
</html>
